<template>
  <div class="box">
    <canvas class="canvas" ref="canvasRef"></canvas>
  </div>
</template>

<script>
import TextGranulation from './text-granulation';
export default {
  name: '',
  components: {},
  data() {
    return {};
  },
  computed: {},
  created() {},
  mounted() {
    TextGranulation.init({ text: '中国' });
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  height: 100%;
  canvas {
    width: 100%;
    height: 100%;
  }
}
/*! shape-shifter 2013-08-14 */
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
  display: block;
}
audio,
canvas,
video {
  display: inline-block;
}
audio:not([controls]) {
  display: none;
  height: 0;
}
[hidden] {
  display: none;
}
html {
  font-family: sans-serif;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
body {
  margin: 0;
}
a:focus {
  outline: thin dotted;
}
a:active,
a:hover {
  outline: 0;
}
h1 {
  font-size: 2em;
}
abbr[title] {
  border-bottom: 1px dotted;
}
b,
strong {
  font-weight: 700;
}
dfn {
  font-style: italic;
}
mark {
  background: #ff0;
  color: #000;
}
code,
kbd,
pre,
samp {
  font-family: monospace, serif;
  font-size: 1em;
}
pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
}
q {
  quotes: '\201C''\201D''\2018''\2019';
}
small {
  font-size: 80%;
}
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}
img {
  border: 0;
}
svg:not(:root) {
  overflow: hidden;
}
figure {
  margin: 0;
}
fieldset {
  border: 1px solid silver;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
legend {
  border: 0;
  padding: 0;
}
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  margin: 0;
}
button,
input {
  line-height: normal;
}
button,
html input[type='button'],
input[type='reset'],
input[type='submit'] {
  -webkit-appearance: button;
  cursor: pointer;
}
button[disabled],
input[disabled] {
  cursor: default;
}
input[type='checkbox'],
input[type='radio'] {
  box-sizing: border-box;
  padding: 0;
}
input[type='search'] {
  -webkit-appearance: textfield;
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  box-sizing: content-box;
}
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}
textarea {
  overflow: auto;
  vertical-align: top;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
body {
  font-family: Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #79a8ae;
  color: #666;
  font-size: 16px;
  line-height: 1.5em;
}
h1 {
  color: #111;
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.5em;
}
p {
  margin: 0 0 10x;
}
a {
  color: #888;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
}
a:hover {
  border-bottom-color: #888;
}
body,
.overlay {
  -webkit-perspective: 1000;
  -webkit-perspective-origin-y: 25%;
}
.body--ready {
  background: -webkit-linear-gradient(top, #cbebdb 0, #3794c0 120%);
  background: -moz-linear-gradient(top, #cbebdb 0, #3794c0 120%);
  background: -o-linear-gradient(top, #cbebdb 0, #3794c0 120%);
  background: -ms-linear-gradient(top, #cbebdb 0, #3794c0 120%);
  background: linear-gradient(top, #cbebdb 0, #3794c0 120%);
}
.body--ready .overlay {
  -webkit-transition: -webkit-transform 0.7s
      cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -moz-transition: -moz-transform 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -ms-transition: -ms-transform 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -o-transition: -o-transform 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1);
  transition: transform 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.7s cubic-bezier(0.694, 0.0482, 0.335, 1);
}
.body--ready .ui,
.body--ready .help {
  display: block;
}
.ui {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 300px;
  margin-left: -150px;
}
.ui-input {
  width: 100%;
  height: 50px;
  background: 0;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  border: 0;
  border-bottom: 2px solid #fff;
}
.ui-input:focus {
  outline: 0;
  border: 0;
  border-bottom: 2px solid #fff;
}
.ui-return {
  display: none;
  position: absolute;
  top: 20px;
  right: 0;
  padding: 3px 2px 0;
  font-size: 10px;
  line-height: 10px;
  color: #fff;
  border: 1px solid #fff;
}
.ui--enter .ui-return {
  display: block;
}
.ui--wide {
  width: 76%;
  margin-left: 12%;
  left: 0;
}
.ui--wide .ui-return {
  right: -20px;
}
.help {
  display: none;
  position: absolute;
  top: 40px;
  right: 40px;
  width: 25px;
  height: 25px;
  text-align: center;
  font-size: 13px;
  line-height: 27px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #79a8ae;
  opacity: 0.9;
  -webkit-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -moz-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -ms-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -o-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
}
.help:hover {
  opacity: 1;
}
.overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 550px;
  height: 490px;
  margin: -260px 0 0 -275px;
  opacity: 0;
  -webkit-transform: rotateY(90deg);
  -moz-transform: rotateY(90deg);
  -ms-transform: rotateY(90deg);
  -o-transform: rotateY(90deg);
  transform: rotateY(90deg);
}
.overlay--visible {
  opacity: 1;
  -webkit-transform: rotateY(0);
  -moz-transform: rotateY(0);
  -ms-transform: rotateY(0);
  -o-transform: rotateY(0);
  transform: rotateY(0);
}
.ui-share,
.ui-details {
  opacity: 0.9;
  background: #fff;
  z-index: 2;
}
.ui-details-content,
.ui-share-content {
  padding: 100px 50px;
}
.commands {
  margin: 0;
  padding: 0;
  list-style: none;
  cursor: pointer;
}
.commands-item {
  font-size: 12px;
  line-height: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 20px;
  background: #fff;
  margin-top: 1px;
  color: #333;
  opacity: 0.9;
  -webkit-transition: -webkit-transform 0.7s
      cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -moz-transition: -moz-transform 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -ms-transition: -ms-transform 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -o-transition: -o-transform 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  transition: transform 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1),
    opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
}
.commands-item--gap {
  margin-top: 9px;
}
.commands-item:hover {
  opacity: 1;
}
.commands-item:hover .commands-item-action {
  background: #333;
}
.commands-item a {
  display: inline-block;
}
.commands-item-mode {
  display: inline-block;
  margin-left: 3px;
  font-style: italic;
  color: #ccc;
}
.commands-item-title {
  display: inline-block;
  width: 150px;
}
.commands-item-info {
  display: inline-block;
  width: 300px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #aaa;
}
.commands-item-action {
  display: inline-block;
  float: right;
  margin-top: 3px;
  text-transform: uppercase;
  font-size: 10px;
  line-height: 10px;
  color: #fff;
  background: #90c9d1;
  padding: 5px 10px 4px;
  border-radius: 3px;
}
.commands-item:first-child {
  margin-top: 0;
}
.twitter-share {
  position: absolute;
  top: 4px;
  right: 20px;
}
.tabs-labels {
  margin-bottom: 9px;
}
.tabs-label {
  display: inline-block;
  background: #fff;
  padding: 10px 20px;
  font-size: 12px;
  line-height: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #333;
  opacity: 0.5;
  cursor: pointer;
  margin-right: 2px;
  -webkit-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -moz-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -ms-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  -o-transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
  transition: opacity 0.1s cubic-bezier(0.694, 0.0482, 0.335, 1);
}
.tabs-label:hover {
  opacity: 0.9;
}
.tabs-label--active {
  opacity: 0.9;
}
.tabs-panel {
  display: none;
}
.tabs-panel--active {
  display: block;
}
.tab-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
.touch .ui-input {
  display: none;
}
@media screen and (max-height: 600px) {
  .ui-input {
    color: #111;
    border-color: #111;
  }
  .ui-input:focus {
    border-color: #111;
  }
}</style
>.
